package com.dks.controller.publicCompoment;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.dks.enumeration.DictionaryType;
import com.dks.models.publicCompoment.PublicDictionary;
import com.dks.repository.IPublicDictionaryRepository;
import com.dks.result.ResultModel;

/**
 * 公共-字典
 */
@RestController
@RequestMapping("dictionary")
public class PublicDictionaryController{

    @Autowired
    private IPublicDictionaryRepository publicDictionaryRepository;

    /**
     * 根据字典表类型查询字典数据
     * @author evan
     */
    @GetMapping("{type}")
    public ResultModel<List<PublicDictionary>> getByType(@PathVariable("type") DictionaryType dictionaryType){
        return publicDictionaryRepository.getByType(dictionaryType);
    }


}
